package com.mybatis_puls.demo.pojo;

import com.baomidou.mybatisplus.annotation.*;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;

import java.util.Date;

@Data
@AllArgsConstructor
@NoArgsConstructor
public class User {
 //对应数据库的主键（uuid ,雪花算法，redis，）
 @TableId(type = IdType.AUTO) //id自增
 private Long id;
 private String name;
 private Integer age;
 private String email;

  //更新时间
 @TableField(fill = FieldFill.INSERT)
 private Date createTime;
 @TableField(fill = FieldFill.UPDATE)
 private Date updateTime;

 //乐观锁
 @Version
 private Integer version;

 //逻辑删除
 @TableLogic
 private Integer deleted;
}
